package com.buer.train.business.service.impl;

import com.buer.train.business.dao.TrainningMechanismDao;
import com.buer.train.business.domain.TrainningMechanismDO;
import com.buer.train.business.service.TrainningMechanismService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;



@Service
public class TrainningMechanismServiceImpl implements TrainningMechanismService {
	@Autowired
	private TrainningMechanismDao trainningMechanismDao;
	
	@Override
	public TrainningMechanismDO get(Integer id){
		return trainningMechanismDao.get(id);
	}
	
	@Override
	public List<TrainningMechanismDO> list(Map<String, Object> map){
		return trainningMechanismDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return trainningMechanismDao.count(map);
	}
	
	@Override
	public int save(TrainningMechanismDO trainningMechanism){
		return trainningMechanismDao.save(trainningMechanism);
	}
	
	@Override
	public int update(TrainningMechanismDO trainningMechanism){
		return trainningMechanismDao.update(trainningMechanism);
	}
	
	@Override
	public int remove(Integer id){
		return trainningMechanismDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return trainningMechanismDao.batchRemove(ids);
	}

    @Override
    public PageInfo<TrainningMechanismDO> getTrainningMechanismList(Map<String, Object> map) {
        PageHelper.startPage(map); //开始起始页
        List<TrainningMechanismDO> list = trainningMechanismDao.getTrainningMechanismList(map); // 获取数据
        PageInfo<TrainningMechanismDO> page = new PageInfo<>(list); // 实例化PageInfo
        return page;
    }

    @Override
    public TrainningMechanismDO getOne(Map<String, Object> map){
        return trainningMechanismDao.getOne(map);
    }
	
}
